package com.ly.common.exception;


import com.ly.common.constant.MessageConstant;

import java.util.Map;

/**
 * 自定义参数异常类
 * @Auther: lzw
 * @Date: 2018/6/4
 */
public class ParamsVaildErrException extends RuntimeException {

    private String exceptionCode;
    private String exceptionMesssage;
    private Map<String,String> errorMap;
    private Map<String,Object> errorObjMap;

    public ParamsVaildErrException(String exceptionCode, String exceptionMessage) {
        this.exceptionCode = exceptionCode;
        this.exceptionMesssage = exceptionMessage;
    }

    public ParamsVaildErrException(String exceptionCode, String exceptionMessage,Map<String,String> errorMap) {
        this.exceptionCode = exceptionCode;
        this.exceptionMesssage = exceptionMessage;
        this.errorMap=errorMap;
    }

    public ParamsVaildErrException(MessageConstant messageConstant,Map<String,Object> errorObjMap) {
        this.exceptionCode = messageConstant.getCode();
        this.exceptionMesssage = messageConstant.getDesc();
        this.errorObjMap=errorObjMap;
    }

    public ParamsVaildErrException(Map<String,String> errorMap) {
        this.exceptionCode = MessageConstant.ERR_PARAMETER.getCode();
        this.exceptionMesssage = MessageConstant.ERR_PARAMETER.getDesc();
        this.errorMap=errorMap;
    }

    public ParamsVaildErrException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

    public ParamsVaildErrException(String message, Throwable cause) {
        super(message, cause);
    }

    public ParamsVaildErrException(String message) {
        super(message);
    }

    public ParamsVaildErrException(Throwable cause) {
        super(cause);
    }

    public String getExceptionCode() {
        return exceptionCode;
    }

    public void setExceptionCode(String exceptionCode) {
        this.exceptionCode = exceptionCode;
    }

    public String getExceptionMesssage() {
        return exceptionMesssage;
    }

    public void setExceptionMesssage(String exceptionMesssage) {
        this.exceptionMesssage = exceptionMesssage;
    }

    public Map<String, String> getErrorMap() {
        return errorMap;
    }

    public void setErrorMap(Map<String, String> errorMap) {
        this.errorMap = errorMap;
    }

    public Map<String, Object> getErrorObjMap() {
        return errorObjMap;
    }

    public void setErrorObjMap(Map<String, Object> errorObjMap) {
        this.errorObjMap = errorObjMap;
    }
}
